<!DOCTYPE html>
<html>

<head>
    <title>Basis : the programming language</title>
    <link rel="shortcut icon" href="favicon.ico">
    <style>
        body {
            background: #fff;
            font-family: sans-serif;
            margin: 0px;
            padding: 0px;
            font-size: 1.2vw;
        }

        #wrap {
            max-width: 100vw;
            max-height: 100vh;
            width: 100vh;
            height: 100vw;
            margin: auto;
        }

        #wrap img {
            max-height: 70%;
            max-width: 70%;
            width: auto;
            height: auto;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            margin: auto;
        }

        #footer {
            clear: both;
            display: block;
            text-align: center;
            margin: 0px auto;
            position: absolute;
            bottom: 0px;
            width: 100%;
        }

        .prettyprint {
            font-size: 1.28vw;
        }

        .code {
            display: flex;
            margin-left: -1vw;
        }
        .code pre {
            flex: 1;
            width: 10vw !important;
            padding-left: 1vw !important;
            padding-top: 0.5vw !important;
            padding-bottom: 0.5vw !important;
            border: 0 !important;
            background: #eee !important;
            border-radius: 1vw !important;
            margin-left: 1vw;
            line-height: 150%;
        }
    </style>
</head>

<body style="width:100%">
    <div id="wrap">
        <a href="https://zhuanlan.zhihu.com/p/68906047" target="_blank"><img src='basislang.png'></a>
    </div>
    <div style="position: absolute; top: 77vh; width: 80vw; margin: 0 10vw; line-height: 1.5">
        Basis is like C++ meets Python, plus a flexible grammar. These are all valid Basis programs:
        <div class="code">
            <pre class="prettyprint">
module main
import sys.console as console
    

tellPrime : (n)    
  n ≤ 1 : 'bad'               
  for i = 2, i * i ≤ n, i++
    n % i == 0 : 'bad'
  return 'good'



main :
  print = console.writeLine 
  print(tellPrime(17))</pre>
            <pre class="prettyprint">
module main      
import sys.object.*  
import sys.console as console

tellPrime : (int n) ⇒ string    
  if n ≤ 1
    return 'bad'
  for i = 2, i * i ≤ n, i++
    if n % i == 0
      return 'bad'
  return 'good'

main : void
  print = console.writeLine 
  print(tellPrime(17))</pre>
            <pre class="prettyprint">
module main
import sys.object.*        
import sys.console as console    

tellPrime(int n) : string {
  if n ≤ 1 { return 'bad' }           
  for i = 2, i * i ≤ n, i++ {
    if n % i == 0 { return 'bad' }
  }
  return 'good'
}

void main() {
  print = console.writeLine
  print(tellPrime(17))
}
</pre>
        </div>
        Basis is available on <a href="https://github.com/BlinkDL/Basis" target="_blank">GitHub</a>. It's still at a very early stage, and contributions are welcome. License: MIT.
        <div style="margin-bottom: 15vh"> </div>
    </div>
</body>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>

</html>
